﻿using Messhall.Framework.Domain;
using Messhall.Framework.Domain.DomainObject;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Messhall.Domain.System.BusinessObjects
{
    public class Users : DomainObjectsBase, IAggregateRoot
    {
        #region 成员变量

        /// <summary>
        /// 用户名称
        /// </summary>
        public string Name { get; private set; }

        /// <summary>
        /// 用户手机号
        /// </summary>
        public string Mobile { get; private set; }

        /// <summary>
        /// 用户编号
        /// </summary>
        public string AccountNo { get; private set; }

        /// <summary>
        /// 用户密码
        /// </summary>
        public string PassWord { get; private set; }

        /// <summary>
        /// 账户余额
        /// </summary>
        public decimal Money { get; private set; }

        /// <summary>
        /// 是否是Vip
        /// </summary>
        public bool IsVip { get; private set; }

        /// <summary>
        /// 微信OpenId
        /// </summary>
        public string OpenId { get; private set; }

        /// <summary>
        /// 积分
        /// </summary>
        public int Integral { get; private set; }

        #endregion

        public Users(string name, string mobile, string accountNo, string passWord, decimal money)
        {
            this.Name = name;
            this.Mobile = mobile;
            this.AccountNo = accountNo;
            this.PassWord = passWord;
            this.Money = money;
        }

        public void SetName(string name)
        {
            this.Name = name;
        }

        public void SetAccountNo(string accountNo)
        {
            this.AccountNo = accountNo;
        }

        public void SetMobile(string mobile)
        {
            this.Mobile = mobile;
        }

        public void SetPassWord(string passWord)
        {
            this.PassWord = passWord;
        }

        public void SetMoney(decimal money)
        {
            this.Money = money;
        }

        public void SetVip()
        {
            this.IsVip = true;
        }

        public void SetOpenId(string openId)
        {
            this.OpenId = openId;
        }

        public void SetIntegral(int integral)
        {
            this.Integral = integral;
        }
    }
}
